package com.kunchi.wms.stock.service;

import com.kunchi.isb.base.exception.ISBException;
import com.kunchi.wms.stock.dao.StockMapper;
import com.kunchi.wms.stock.po.Stock;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class StockService {
    @Autowired
    StockMapper stockMapper;

    public List<Stock> findAll() throws ISBException {
      return  stockMapper.findAll();
    }

    public Stock add(Stock stock)throws ISBException{
        stockMapper.add(stock);
        return stock;
    }

    public Stock update(Stock stock) throws  ISBException{
        stockMapper.update(stock);
        return stock;
    }
}
